﻿<!DOCTYPE HTML>
<html>
{include file="public:header_css"}
<body>
<header class="navbar-wrapper">
	<div class="navbar navbar-fixed-top">
		<div class="container-fluid cl">
			<a class="logo navbar-logo f-l mr-10 hidden-xs" onclick="out(this)" href="javascript:;">退出</a>
			<!--<a class="logo navbar-logo-m f-l mr-10 visible-xs" href="/aboutHui.shtml">H-ui</a>-->
			<!--<span class="logo navbar-slogan f-l mr-10 hidden-xs">v3.1</span>-->
			<a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
		</div>
	</div>
</header>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <a class="btn btn-primary radius" href="{:url('teacher.article/add_article')}?shop_id={$shop_id}">
				<i class="gr gr-houtui"></i> 添加文章
			</a>
		</span>
        <span class="r">共有数据：<strong>{$total}</strong> 条</span>
	</div>

	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
			<tr class="text-c">
				<!-- <th width="40"><input name="" type="checkbox" value=""></th> -->
				<th width="80">ID</th>
				<th width="100">分类</th>
				<th width="150">标题</th>
				<th width="150">创建时间</th>
				<th width="60">状态</th>
				<th width="100">操作</th>
			</tr>
			</thead>
			<tbody>
			{foreach name="list" item="v" key="k"}
			<tr class="text-c">
				<td>{$v.id}</td>
				<td class="text-c">{$v.sort}</td>
				<td class="text-c">{$v.title}</td>
				<td class="text-c">{$v.create_time|date="Y-m-d",###}</td>
				<td class="td-status">
					{if $v.status == 1}
						<span class="label label-success radius"  href="javascript:;">已审核</span>
					{elseif $v.status == 0}
						<span class="label label-danger radius"  href="javascript:;">未审核</span>
					{else}
						<span class="label label-danger radius"  href="javascript:;">已拒绝</span>
					{/if}
				</td>
				<td class="td-manage">
					{if $v.edit==0}
					<a style="text-decoration:none" class="ml-5" href="art_edit.html?id={$v.id}" title="只可编辑一次哦">
						<i class="Hui-iconfont" style="font-size:20px;">&#xe6df;</i>
					</a>
					{/if}
					<a style="text-decoration:none" class="ml-5" onClick="del('{$v.id}')" href="javascript:;" title="删除">
						<i class="Hui-iconfont" style="font-size:20px;">&#xe6e2;</i>
					</a>
				</td>
			</tr>
			{/foreach}
			</tbody>
		</table>
	</div>

	{$page}

</div>


</body>
{include file="public:footer_js"}

<script type="text/javascript" src="__STATIC__/admin/lib/layer/2.4/layer.js"></script>

<script type="text/javascript">
    var teacher_id="{$teacher_id}";
    /**
     * 删除
     */
    function del(id)
    {
        var notice = "确认删除吗？";

        layer.confirm(notice,function (index) {
            $.post(
                '{:url("art_del")}?id='+id,
                {
                    is_del:1
                },
                function (res) {
                    if(res.code === 1){
                        layer.msg("删除成功",{icon:6,time:1000});

                        // 两秒后跳转到列表页
                        setTimeout(function () {
                            location.replace(location.href);
                        },2000);

                    }else{
                        layer.msg(res.msg,{icon:5,time:1000});
                    }
                }
            );
        });
    }

    // 退出
    function out(that) {
        $.post("{:url('out')}",{teacher_id:teacher_id},function (res) {
            if(res.code === 1){
                layer.msg(res.msg,{icon:6,time:2000});
                location.href="{:url('/store/teacher.article/wincode')}?shop_id={$shop_id}";
            }else{
                layer.msg(res.msg,{icon:6,time:2000});
            }
        })
    }
</script>
</html>